<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.time.chrono.Gregorian</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.time.chrono.Gregorian");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461">tango.time.chrono.Gregorian</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Mid 2005: Initial release
                        Apr 2007: reshaped<br><br>
<b>author:</b><br>John Chapman, Kris, schveiguy<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L31">Gregorian</a></span>
<script>explorer.outline.addDecl('Gregorian');</script> : Calendar;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">
 Represents the Gregorian calendar.</font><br><br>
<font color="black">Note that this is the Proleptic Gregorian calendar.  Most calendars assume
 that dates before 9/14/1752 were Julian Dates.  Julian differs from
 Gregorian in that leap years occur every 4 years, even on 100 year
 increments.  The Proleptic Gregorian calendar applies the Gregorian leap
 year rules to dates before 9/14/1752, making the calculation of dates much
 easier.
 </font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Gregorian <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L37">generic</a></span>
<script>explorer.outline.addDecl('generic');</script>; [public, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">static shared instance</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>enum;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Represents the current era.
        </font><br><br>
</dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>static <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L63">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">create a generic instance of this calendar
        </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L72">this</a></span>
<script>explorer.outline.addDecl('this');</script>(Type <span class="funcparam">type</span> = Type.Localized);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Initializes an instance of the Gregorian class using the specified GregorianTypes value. If no value is 
 specified, the default is Gregorian.Types.Localized.
        </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L90">toTime</a></span>
<script>explorer.outline.addDecl('toTime');</script>(uint <span class="funcparam">year</span>, uint <span class="funcparam">month</span>, uint <span class="funcparam">day</span>, uint <span class="funcparam">hour</span>, uint <span class="funcparam">minute</span>, uint <span class="funcparam">second</span>, uint <span class="funcparam">millisecond</span>, uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns a Time value set to the specified date and time in the specified _era.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">year</span></td><td>An integer representing the _year.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">month</span></td><td>An integer representing the _month.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">day</span></td><td>An integer representing the _day.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">hour</span></td><td>An integer representing the _hour.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">minute</span></td><td>An integer representing the _minute.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">second</span></td><td>An integer representing the _second.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">millisecond</span></td><td>An integer representing the _millisecond.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">era</span></td><td>An integer representing the _era.</td></tr></table><br>
<b>Returns:</b><br>
A Time set to the specified date and time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>DayOfWeek <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L100">getDayOfWeek</a></span>
<script>explorer.outline.addDecl('getDayOfWeek');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the day of the week in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
A DayOfWeek value representing the day of the week of time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L121">getDayOfMonth</a></span>
<script>explorer.outline.addDecl('getDayOfMonth');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the day of the month in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
An integer representing the day of the month of time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L131">getDayOfYear</a></span>
<script>explorer.outline.addDecl('getDayOfYear');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the day of the year in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
An integer representing the day of the year of time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L141">getMonth</a></span>
<script>explorer.outline.addDecl('getMonth');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the month in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
An integer representing the month in time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L151">getYear</a></span>
<script>explorer.outline.addDecl('getYear');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the year in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
An integer representing the year in time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L161">getEra</a></span>
<script>explorer.outline.addDecl('getEra');</script>(Time <span class="funcparam">time</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the era in the specified Time.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">time</span></td><td>A Time value.</td></tr></table><br>
<b>Returns:</b><br>
An integer representing the era in time.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L177">getDaysInMonth</a></span>
<script>explorer.outline.addDecl('getDaysInMonth');</script>(uint <span class="funcparam">year</span>, uint <span class="funcparam">month</span>, uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the number of days in the specified _year and _month of the specified _era.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">year</span></td><td>An integer representing the _year.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">month</span></td><td>An integer representing the _month.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">era</span></td><td>An integer representing the _era.</td></tr></table><br>
<b>Returns:</b><br>
The number of days in the specified _year and _month of the specified _era.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L195">getDaysInYear</a></span>
<script>explorer.outline.addDecl('getDaysInYear');</script>(uint <span class="funcparam">year</span>, uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the number of days in the specified _year of the specified _era.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">year</span></td><td>An integer representing the _year.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">era</span></td><td>An integer representing the _era.</td></tr></table><br>
<b>Returns:</b><br>
The number of days in the specified _year in the specified _era.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L207">getMonthsInYear</a></span>
<script>explorer.outline.addDecl('getMonthsInYear');</script>(uint <span class="funcparam">year</span>, uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns the number of months in the specified _year of the specified _era.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">year</span></td><td>An integer representing the _year.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">era</span></td><td>An integer representing the _era.</td></tr></table><br>
<b>Returns:</b><br>
The number of months in the specified _year in the specified _era.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L218">isLeapYear</a></span>
<script>explorer.outline.addDecl('isLeapYear');</script>(uint <span class="funcparam">year</span>, uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Indicates whether the specified _year in the specified _era is a leap _year.
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">year</span></td><td>An integer representing the _year.</td></tr></table><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">era</span></td><td>An integer representing the _era.</td></tr></table><br>
<b>Returns:</b><br>
true is the specified _year is a leap _year; otherwise, false.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Type <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L227">calendarType</a></span>
<script>explorer.outline.addDecl('calendarType');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"><i>Property.</i> Retrieves the GregorianTypes value indicating the language version of the Gregorian.
 </font><br><br>
<b>Returns:</b><br>
The Gregorian.Type value indicating the language version of the Gregorian.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L236">eras</a></span>
<script>explorer.outline.addDecl('eras');</script>(); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"><i>Property.</i> Overridden. Retrieves the list of eras in the current calendar.
 </font><br><br>
<b>Returns:</b><br>
An integer array representing the eras in the current calendar.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L246">id</a></span>
<script>explorer.outline.addDecl('id');</script>(); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"><i>Property.</i> Overridden. Retrieves the identifier associated with the current calendar.
 </font><br><br>
<b>Returns:</b><br>
An integer representing the identifier of the current calendar.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L257">split</a></span>
<script>explorer.outline.addDecl('split');</script>(Time <span class="funcparam">time</span>, ref uint <span class="funcparam">year</span>, ref uint <span class="funcparam">month</span>, ref uint <span class="funcparam">day</span>, ref uint <span class="funcparam">doy</span>, ref uint <span class="funcparam">dow</span>, ref uint <span class="funcparam">era</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden.  Get the components of a Time structure using the rules
 of the calendar.  This is useful if you want more than one of the
 given components.  Note that this doesn't handle the time of day,
 as that is calculated directly from the Time struct.
         </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L274">addMonths</a></span>
<script>explorer.outline.addDecl('addMonths');</script>(Time <span class="funcparam">t</span>, int <span class="funcparam">nMonths</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden. Returns a new Time with the specified number of months
 added.  If the months are negative, the months are subtracted.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">t</span></td><td>A time to add the months to</td></tr></table><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">nMonths</span></td><td>The number of months to add.  This can be
 negative.</td></tr></table><br>
<b>Returns:</b><br>
A Time that represents the provided time with the number
 of months added.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/time/chrono/Gregorian.d?rev=3461#L322">addYears</a></span>
<script>explorer.outline.addDecl('addYears');</script>(Time <span class="funcparam">t</span>, int <span class="funcparam">nYears</span>); [override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Overridden.  Add the specified number of years to the given Time.</font><br><br>
<font color="black">Note that the Gregorian calendar takes into account that BC time
 is negative, and supports crossing from BC to AD.<br><br> </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">t</span></td><td>A time to add the years to</td></tr></table><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">nYears</span></td><td>The number of years to add.  This can be negative.</td></tr></table><br>
<b>Returns:</b><br>
A Time that represents the provided time with the number
 of years added.<br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2005 John Chapman. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Jun  8 17:12:55 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>